home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / diff.zip / DIFF.DOC < prev    next >
Text File  |  1986-03-11  |  4KB  |  117 lines

  1.                           DIFF -- File comparator
  2.  
  3.  
  4. Command Format:
  5.  
  6.      diff <file1> <file2> <options>
  7.  
  8.  
  9.  
  10. Options:
  11.  
  12.      -Alterations
  13.      -Match
  14.      -Resynch <n>
  15.      -Header "foo"
  16.      -Blanks
  17.      -Singlecase
  18.  
  19.  
  20.  
  21. Description:
  22.  
  23.     Diff  performs  a  comparison  between  two  ASCII files,  and lists the 
  24.     differences on the console or to redirected output.  The general form of 
  25.     a difference listing is: 
  26.  
  27.          --------------------------------------- <line1>
  28.          some lines from the first file
  29.          --------------------------------------- <line2>
  30.          the corresponding lines from the second file 
  31.  
  32.      Several options are available for changing the way DIFF operates.  They 
  33.      are listed below.  
  34.  
  35.      -Match  specifies  that,  rather  than listing the differences as shown 
  36.      above,  lines that are the same in both files are  to  be  listed.  The 
  37.      header line will specify the line numbers in file1 and file2, separated 
  38.      by a comma.  
  39.  
  40.      -Alters  specifies  that  the  changed lines in file2 are to be listed.  
  41.      The format of the listing is: 
  42.  
  43.           --------------------------------- <line1>
  44.           some lines inserted in second file
  45.           --------------------------------- <line2>, <line3>
  46.           some lines in second file replacing
  47.           lines from the first file.
  48.  
  49.      The first header indicates that the lines  which  follow  are  inserted 
  50.      before  line  #<line1>  in  the  first file;  the second shows that the 
  51.      following lines replace <line2> through <line3> in the first file.  
  52.  
  53.      -Resynch <n> specifies that at least <n> matching  lines  are  required 
  54.      for DIFF to end a set of differing lines.  The default is 3.  
  55.  
  56.      -Header  "foo"  says that "foo" is the string to print at the beginning 
  57.      of a header line.  The default is a string of dashes.  
  58.  
  59.      -Blank causes DIFF to treat all strings of blanks and tabs as  if  they 
  60.      were  single  blanks,  and to ignore trailing blanks and tabs on lines.  
  61.      It is useful if two files have things aligned in different columns, but 
  62.      are otherwise similar.  
  63.  
  64.      -Singlecase causes DIFF to treat lowercase characters the same as their 
  65.      uppercase equivalents.  By default, DIFF respects case differences.  
  66.  
  67.      Any option may be abbreviated to its first character.
  68.  
  69.  
  70.  
  71. Examples:
  72.  
  73.          diff whosis.bak whosis.c
  74.          diff -match myfile herfile >duplines
  75.          diff oldfile newfile -single -resync 4 
  76.  
  77.  
  78.  
  79. Diagnostics:
  80.  
  81.      "Unknown option" -- An unrecognizable option  appears  on  the  command 
  82.      line.  
  83.  
  84.      "-xxx  option  requires  a  value" -- The -Resync or -Header option was 
  85.      specified without giving a value.  
  86.  
  87.      "Files  have  too many differences to compare." -- The two files had so 
  88.      many contiguous lines without a match that DIFF ran out of memory.  
  89.  
  90.      "can't happen" -- DIFF  detected  an  internal  error  condition.  This 
  91.      message should never appear.  
  92.  
  93.  
  94.  
  95. Bugs:
  96.  
  97.      Sometimes, DIFF loses its place in the files, and starts reporting some 
  98.      outrageous  group  of  differences  or  runs  out  of  memory.  If this 
  99.      happens, the file generally has some group of three or more consecutive 
  100.      lines that are identical but appear in the middle of  a  changed  area.  
  101.      If so, a larger value of "-resync" may help.  
  102.  
  103.      Equal  lines  in  the middle of a region of differences are reported as 
  104.      different.  If the comparison doesn't break down, a smaller value of "-
  105.      resync" may edit these out.  
  106.  
  107.  
  108.  
  109. Notes:
  110.  
  111.      If the files have a large number of differences,  DIFF may take quite a 
  112.      while, apparently without disc activity, to find its place.  If you are 
  113.      expecting a large number of differences,  don't worry;  this is normal.  
  114.      If you  aren't  expecting  many  differences,  make  sure  that  you're 
  115.      comparing the correct pair of files.  
  116.  
  117.